home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
program
/
vol16n09.zip
/
DETECTOS.BAT
next >
Wrap
DOS Batch File
|
1996-12-20
|
1KB
|
43 lines
@ECHO OFF
:: Windows NT sets the OS variable to "Windows_NT"
IF '%OS%'=='Windows_NT' GOTO Done
SET OS=
SET WINDIR=
SET WINBOOTDIR=
SET VWD=n
SET VBD=n
IF NOT '%windir%'=='' SET VWD=Y
IF NOT '%winbootdir%'=='' SET VBD=Y
IF NOT '%VWD%%VBD%'=='nn' GOTO Not31
:: Distinguish DOS-pre-7 from Windows 3.x by seeking
:: "windir=" in the output of the SET command.
ECHO SET VWD=n>0.BAT
ECHO SET VWD=Y>1.BAT
SET | FIND /C "windir=" > DETECT$$.BAT
CALL DETECT$$.BAT
FOR %%v IN (0 1 DETECT$$) DO DEL %%v.BAT
:Not31
IF '%VWD%%VBD%'=='nn' SET OS=DOS_pre_7
IF '%VWD%%VBD%'=='nY' SET OS=DOS_7
IF '%VWD%%VBD%'=='Yn' SET OS=Windows_3.x
IF '%VWD%%VBD%'=='YY' SET OS=Windows_95
:Done
ECHO Operating system is %OS%
:: If you NEVER run Windows 3.x under DOS 7, you can
:: delete this comment and the next two lines.
IF NOT '%windir%'=='%winbootdir%' SET VBD=%VBD%n
IF '%VWD%%VBD%'=='YYn' ECHO (or Windows 3.x under DOS 7)
:: Clean up environment variables
FOR %%v IN (VWD VBD) DO SET %%v=